#include<bits/stdc++.h>
using namespace std;
#define int long long

string s[1005];

signed main() {
//	system("start https://www.lanqiao.cn/problems/8088/learning/");

    int n;
    cin >> n;

    getchar();

    int cnt = 0;

    for(int i = 1; i <= n; i++) {
        getline(cin, s[i]);

        if(s[i].empty())	continue;

        if(cnt & 1)	s[i] = "," + s[i];

        cnt++;
    }

    for(int i = 1; i <= n; i++)
        cout << s[i];

    return 0;
}

